<template>
  <div>
    <div>我是A组件 我的值是：{{ flag }}</div>
    <div><button @click="emitB">给b传值</button></div>
  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
const emit = defineEmits(["on-click"]);
let flag = ref(true);
const emitB = () => {
  flag.value = !flag.value;
  emit("on-click", flag);
};
</script>

<style>
</style>